import Vue                from 'vue'
import Router             from 'vue-router'
// 大组件(包裹层)       
import Home               from 'components/app-wrap'
import RHome              from 'components/reading-wrap'
import DHome              from 'components/default-wrap'
import Blank              from 'components/blank'
// 大组件(!包裹层)        
// import Login              from 'components/login'
import Register           from 'components/register'
        
// 小组件        
import Index              from 'components/home/index'
// import Detail             from 'components/home/detail'
import Record             from 'components/record/list'  
import Book               from 'components/book/list'
// import HList              from 'components/home/list'
// import Form               from 'components/form.vue'
        
// import User               from 'components/User/index'
import Shop               from 'components/shop/index'
import ShopDetail         from 'components/shop/detail' 
import Cart               from 'components/shop/cart'
import Confirm            from 'components/shop/confirm'
import Address            from 'components/shop/address'
import Order              from 'components/user/order'
          
import Reading            from 'components/reading/index'
import Rdetail            from 'components/reading/detail'
import InCome             from 'components/income/index'
        
// import Help               from 'components/help'

// 学校的
import Login              from 'components/home/login'
import Search             from 'components/home/search'
import Form               from 'components/home/form'
import Detail             from 'components/home/detail'
import User               from 'components/home/user'
import Help               from 'components/home/help'

// import Recommend from 'components/recommend/recommend'
// import Singer from 'components/singer/singer'
// import Rank from 'components/rank/rank'
// import Search from 'components/search/search'
// import SingerDetail from 'components/singer-detail/singer-detail'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/home/index',
      component: Home,
    },
   
    {
      path: '/home',
      redirect: '/home/index',
      component: Home,
      children: [{
        path: 'index',
        name: 'home/index',
        meta: {
          title: '首页',
          auth : false
        },
        component: Index
      },{
        path: 'search',
        name: '/home/search',
        meta: {
          title: '查询',
          auth: false
        },
        component: Search
      },{
        path: 'login',
        name: '/home/login',
        meta: {
          title: '登入',
          auth: false
        },
        component: Login
      },{
         path: 'form',
          name: '/home/form',
          meta: {
            title: '表单',
            auth: true
          },
          component: Form
      },{
        path: 'detail',
        name: '/home/detail',
        meta: {
          title: '详细',
          auth: true
        },
        component: Detail
      },{
        path: 'user',
        name: '/home/user',
        meta: {
          title: '学生界面',
          auth: true
        },
        component: User
      },{
        path: 'help',
        name: '/home/help',
        meta: {
          title: '详细流程',
          auth: true
        },
        component: Help
      }]
    },
    {
      path: '/shop',
      redirect: '/shop/index',
      component: Home,
      children: [{
        path: 'index',
        name: 'shop/index',
        meta: {
          title: '商场首页',
          auth : true
        },
        component: Shop
      },{
        path: 'detail',
        name: 'shop/detail',
        meta: {
          title: '商品详细',
          auth : true
        },
        component: ShopDetail
      },{
        path: 'cart',
        name: 'shop/cart',
        meta: {
          title: '购物车',
          auth : true
        },
        component: Cart
      },{
        path: 'confirm',
        name: 'shop/confirm',
        meta: {
          title: '订单确认',
          auth : true
        },
        component: Confirm
      },{
        path: 'address',
        name: 'shop/address',
        meta: {
          title: '添加地址',
          auth : true
        },
        component: Address
      }]
    },
    {
     path: '/reading',
     redirect: '/reading/index',
     component: RHome,
     children: [{
       path: 'index',
       name: 'reading/index',
       meta: {
         title: '文章列表',
         auth : true
       },
       component: Reading
      },{
        path: 'detail',
        name: 'reading/Rdetail',
        meta: {
          title: '阅读详细',
          auth : true
        },
        component: Rdetail
      }]
    },
    {
     path: '/user',
     redirect: '/user/index',
     component: Home, 
     children: [{
       path: 'index',
       name: 'user/index',
       meta: {
         title: '用户首页',
         auth : true
       },
       component: User
      }]
    },
    {
      path: '/order',
      component: Blank,
      redirect: '/order/lists',
      children: [{
        path: 'lists',
        name: '/order/index',
        meta: {
          title: '订单首页',
          auth : true
        },
        component: Order
      }]
    },
    // {
    //   path: '/default',
    //   redirect: 'default/login',
    //   component: DHome,
    //   children: [{
    //     path: 'login',
    //     name: 'login',
    //     meta: {
    //       title: '登录页面',
    //       auth : false
    //     },
    //     component: Login
    //   },{
    //   path: 'register',
    //     name: 'register',
    //     meta: {
    //       title: '注册页面',
    //       auth : false
    //     },
    //     component: Register
    //   },{
    //     path: 'form',
    //     name: 'form',
    //     meta: {
    //       title: '完善信息',
    //       auth : true
    //     },
    //     component: Form
    //   }]
    // },
    {
      path: '/help',
      name: 'help',
      meta: {
        title: "用户指南",
        auth : true
      },
      component: Help
    },
    {
      path: '/record',
      component: DHome,
      redirect: '/record/lists',
      children: [{
        path: 'lists',
        name: '/record/lists',
        meta: {
          title: "消费/消费 记录",
          auth : true
        },
        component: Record
      }]
    },
    {
      path: '/book',
      component: DHome,
      redirect: '/book/lists',
      children: [{
        path: 'lists',
        name: '/book/lists',
        meta: {
          title: "书籍 列表",
          auth : true
        },
        component: Book
      }]
    },
    {
      path: '/income',
      component: DHome,
      redirect: '/income/index',
      children: [{
        path  : 'index',
        name  : 'income/index',
        meta  : {
          title: '余额/充值',
          auth : true
        },
        component: InCome
      }]
    },
    {
      path: '/login',
      component: Login,
      name: 'login',
      meta: {
        title: '登入',
        auth: false
      }
    },
    {
      path: '/register',
      component: Register,
      name: 'register',
      meta: {
        title: '注册',
        auth: false
      }
    },
    {
      path: '/form',
      component: Form,
      name: 'form',
      meta: {
        title: '完善信息',
        auth: true
      }
    }
    
    // {
    //   path: '/about',
    //   component: About
    // },
    // {
    //   path: '/product',
    //   component: Product
    // },
    // {
    //   path: '/contact',
    //   component: Contact
    // },
    // {
    //   path: '/login',
    //   component: Login
    // },
    // {
    //   path: '/register',
    //   component: Register
    // }
  ]
})
